package com.wsc.wisdomchina.ai.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by liuhaigang on 2016/12/19.
 */
public class DbHelper extends SQLiteOpenHelper {

    public DbHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    public DbHelper(Context context) {
        super(context, DBContant.DB_NAME,null, DBContant.DB_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
//        db.execSQL("create table "+ DBContant.CSTableName+" (_id integer primary key autoincrement,type_user integer not null,type_message integer not null,content_text varchar(200),path varchar(50),time_voice integer,times varchar(13))");
//        db.execSQL("create table "+ DBContant.IBenTableName+" (_id integer primary key autoincrement,type_user integer  not null,type_message integer not null,content_text varchar(200),path varchar(50),time_voice integer,times varchar(13),richtitle varchar(50)," +
//                " richImgpath varchar(50),richDesc varchar(50) )");
        db.execSQL("create table "+ DBContant.IBenTableChatData+" (_id integer primary key autoincrement,type_user integer  not null,type_message integer not null,content_text varchar(200),path varchar(50),time_voice float,times varchar(13),richtitle varchar(50)," +
                " richImgpath varchar(50),richDesc varchar(50) )");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
